import axios from 'axios'


export function getThemeApi() {
  const jwt = localStorage.getItem("token");
  return axios.get("/api/theme", {
    headers: {
      'token': jwt
    }
  })
}

export function getGoodsApi() {
  const jwt = localStorage.getItem("token");
  return axios.get("/api/category/all", {
    headers: {
      'token': jwt,
    }
  })
}

export function getSpuApi() {
  const jwt = localStorage.getItem("token");
  return axios.post("/api/spu/all", null,
    {
      headers: {
        'token': jwt,
      }
    }
  )
}

export function putSpu(spu) {
  const jwt = localStorage.getItem("token");
  return axios.post("/api/order/add", {
    spu: spu
  },
    {
      headers: {
        'token': jwt,
      }
    }
  )
}